package com.zly.framework.rbac.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zly.framework.rbac.model.entity.Role;
import com.zly.framework.rbac.model.entity.User;

import java.util.List;

public interface RoleService extends IService<Role> {
    /**
     * 获取用户的角色
     *
     * @param user 用户
     * @return role
     */
    List<Role> getAllRolesByUserId(User user);

    /**
     * 分配角色和权限
     *
     * @param roleId        角色id
     * @param permissionIds 权限ids
     */
    void grantPermission(Long roleId, List<Long> permissionIds);
}
